<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@page import="com.cararchive.CarArchiveVO"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List list = (List)request.getAttribute("list");
%>
<html> 
	<head> 
	<title>客运车辆信息登记表2打印页</title> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
	<!--media=print 这个属性可以在打印时有效--> 
	<style media=print> 
		.Noprint{display:none;}<!--用本样式在打印时隐藏非打印项目--> 
		.PageNext{page-break-after: always;}<!--控制分页-->
	</style>

	<style>
		.style_tab_head 
		{ 
		font-family: "仿宋_GB2312"; 
		font-size: 22pt; 
		}
		.forcePage
		{
		page-break-after : always;
		}
		.style_td 
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 30px;
		}
		.style_td2
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 60px;
		}
		.style_td3
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 90px;
		}
		.style_tab 
		{ 
		border-color: #000000 #000000 #000000 #000000; 
		border-style: solid; 
		border-top-width: 2px; 
		border-right-width: 2px; 
		border-bottom-width: 1px; 
		border-left-width: 1px; 
		}
		.NOPRINT { 
		font-family: "宋体"; 
		font-size: 9pt; 
		}
	</style>
	</head>
	
	<body>
		<center class="Noprint"> 
			<p> 
				<input type=button value=返回 onclick="window.history.back()"> 
			</p> 
		</center>
		<%
		for (int i=0; null!=list && i<list.size(); i++) {
			CarArchiveVO vo = (CarArchiveVO)list.get(i);
			if (i!=0) {
		%>
		<div class="forcePage">&nbsp;</div>
		<%
			}
		%>
		<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td> 
			</tr>
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3" align="center" class="style_tab_head">客  运  车  辆  信  息  登  记  表   2</td> 
			</tr>
			<tr>
				<%
					String squadron = "&nbsp;";
					if ( vo.getSquadron()!=null && !"".equals(vo.getSquadron())) {
						squadron = vo.getSquadron();
					}
				%>
				<td width="35%">&nbsp;</td> 
				<td width="35%">&nbsp;</td> 
				<td width="30%"><%=squadron%></td>
			</tr>
			<tr> 
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr> 
			<tr>
				<td colspan="3">
					<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="style_tab"> 
						<tr>
							<%
								String drivername = "&nbsp;";
								if ( vo.getDrivername()!=null && !"".equals(vo.getDrivername())) {
									drivername = vo.getDrivername();
								}
							%>
							<td width="10%" class="style_td" rowspan="5">驾<br/>驶<br/>员</td>
							<td width="10%" class="style_td">姓  名</td>
							<td width="20%" class="style_td" colspan="2"><%=drivername%></td>
							<td width="60%" class="style_td" rowspan="2" colspan="6">驾驶人变更信息</td>
						</tr>
						<tr>
							<%
								String driveridcard = "&nbsp;";
								if ( vo.getDriveridcard()!=null && !"".equals(vo.getDriveridcard())) {
									driveridcard = vo.getDriveridcard();
								}
							%>
							<td width="10%" class="style_td">证  号</td>
							<td width="20%" class="style_td" colspan="2"><%=driveridcard%></td>
						</tr>
						<tr>
							<%
								String driverlevel = "&nbsp;";
								if ( vo.getDriverlevel()!=null && !"".equals(vo.getDriverlevel())) {
									driverlevel = vo.getDriverlevel();
								}
							%>
							<td width="10%" class="style_td">准  驾</td>
							<td width="20%" class="style_td" colspan="2"><%=driverlevel%></td>
							<td width="10%" class="style_td" rowspan="2">变更时间</td>
							<td width="10%" class="style_td" rowspan="5">驾<br/>驶<br/>员</td>
							<td width="10%" class="style_td">姓名</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<%
								String driverphone = "&nbsp;";
								if ( vo.getDriverphone()!=null && !"".equals(vo.getDriverphone())) {
									driverphone = vo.getDriverphone();
								}
							%>
							<td width="10%" class="style_td">电  话</td>
							<td width="20%" class="style_td" colspan="2"><%=driverphone%></td>
							<td width="10%" class="style_td">证  号</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<%
								String drivercertificate = "&nbsp;";
								if ( vo.getDrivercertificate()!=null && !"".equals(vo.getDrivercertificate())) {
									drivercertificate = vo.getDrivercertificate();
								}
							%>
							<td width="10%" class="style_td">上岗证</td>
							<td width="20%" class="style_td" colspan="2"><%=drivercertificate%></td>
							<td width="10%" class="style_td" rowspan="3">&nbsp;</td>
							<td width="10%" class="style_td">准  驾</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<%
								String yearlyinspection = "&nbsp;";
								if ( vo.getYearlyinspection()!=null && !"".equals(vo.getYearlyinspection())) {
									yearlyinspection = vo.getYearlyinspection();
								}
							%>
							<td width="20%" class="style_td" rowspan="4" colspan="2">车辆年检</td>
							<td width="20%" class="style_td" colspan="2"><%=yearlyinspection%></td>
							<td width="10%" class="style_td">电话</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td">上岗证	</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td" rowspan="2">变更时间</td>
							<td width="10%" class="style_td" rowspan="5">驾<br/>驶<br/>员</td>
							<td width="10%" class="style_td">姓名</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td">证  号</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<%
								String forceinsurance = "&nbsp;";
								if ( vo.getForceinsurance()!=null && !"".equals(vo.getForceinsurance())) {
									forceinsurance = vo.getForceinsurance();
								}
							%>
							<td width="20%" class="style_td" rowspan="4" colspan="2">交强险</td>
							<td width="20%" class="style_td" colspan="2"><%=forceinsurance%></td>
							<td width="10%" class="style_td" rowspan="3">&nbsp;</td>
							<td width="10%" class="style_td">准驾</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td">电话</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td">上岗证</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="10%" class="style_td" rowspan="2">变更时间</td>
							<td width="10%" class="style_td" rowspan="5">驾<br/>驶<br/>员</td>
							<td width="10%" class="style_td">姓名</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="20%" class="style_td" rowspan="4" colspan="4">备注：</td>
							<td width="10%" class="style_td">证  号</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="10%" class="style_td" rowspan="3">&nbsp;</td>
							<td width="10%" class="style_td">准驾</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="10%" class="style_td">电话</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
						<tr>
							<td width="10%" class="style_td">上岗证</td>
							<td width="30%" class="style_td" colspan="3">&nbsp;</td>
						</tr>
					</table>
				</td> 
			</tr> 
		</table>
		<%
		}
		%>
	</body> 
</html>
<script language="javascript">
	var hkey_root="HKEY_CURRENT_USER" ; 
	var hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; 
	var hkey_key;
	function doPrint() {    
		//直接调用WebBrowser的打印，要打印预览的话是ExecWB(7,1) 直接打印ExecWB(6,6)
     	document.all.WebBrowser.ExecWB(6,6); 
	} 
	//设置纸张方向 
	function setupLandscape() { 
		try{ 
			var wsShell= new ActiveXObject("WScript.Shell"); 
			//打印页面的Menubar必须可见，此操作类似按键盘上的Alt+F+U也就是 调出页面设置对话框 
			wsShell.sendKeys('%fu'); 
			//此操作类似按键盘上的Alt+A也就是 设置横向打印 
			wsShell.sendKeys('%a');
			//此操作类似按键盘上的Alt+O也就是 设置竖向打印 
			//wsShell.sendKeys('%o'); 
			//此操作类似按键盘上的回车 页面设置对话框的默认焦点在 确定上 所以直接确定 
			wsShell.sendKeys('{ENTER}'); 
		} 
		catch(e){} 
	} 
	//设置默认的页眉页脚 
	function setupPage() { 
		try{ 
		var RegWsh = new ActiveXObject("WScript.Shell"); 
			hkey_key="header" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"") 
			hkey_key="footer" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&b") //去掉了&u 因为我不想显示当前打印页的网址 
			hkey_key="margin_bottom"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); //0.39相当于把页面设置里面的边距设置为10 
			hkey_key="margin_left"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_right"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_top"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
		} 
		catch(e){} 
	} 
	setTimeout("setupLandscape()",1000); 
	setTimeout("setupPage()",2000); 
	setTimeout("doPrint()",3000); 
</script>